<?php

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use Dcat\Admin\Admin;

Admin::routes();

Route::group([
    'prefix' => config('admin.route.prefix'),
    'namespace' => config('admin.route.namespace'),
    'middleware' => config('admin.route.middleware'),
], function (Router $router) {

    $router->get('/index', 'HomeController@index');

    $router->group([
        'prefix' => 'scm',
        'as' => 'scm.',
    ], function (Router $router) {
        $router->resource('orgs', \App\Admin\Controllers\Scm\OrgController::class);
        $router->resource('companies', \App\Admin\Controllers\Scm\CompanyController::class);
        $router->resource('communities', \App\Admin\Controllers\Scm\CommunityController::class);
        $router->resource('buildings', \App\Admin\Controllers\Scm\BuildingController::class);
    });

});
